import Vue from "vue";
import Router from "vue-router";
import ROUTES from "./routes";

Vue.use(Router);

const isDev = process.env.NODE_ENV === 'development';

const router = new Router({
  base: isDev? '/': '/assessment/',
  mode:'history',
  routes: ROUTES,
});

router.beforeEach((to, from, next) => {
  if (to.meta.title) document.title = to.meta.title;
	if (to.meta.title === null) document.title = '\u200E';
  // console.log('url: ', window.location.href);
  
  next();
});

router.afterEach((to, from) => {
});

export default router;
